<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for</title>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="(thing,index) in array">
                {{index+1}}董景园：{{thing}}
            </li>
            <li v-for="thing in vage">
                {{thing.name}}
            </li>
        </ul>
        <input type="button" value="增加一个" @click="add">
        <input type="button" value="移除一个" @click="remove">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                array:['wo','shi','sha','bi'],
                vage:[
                    {'name':'xiaojiji'},
                    {'name':'daxiang'}
                ]
            },
            methods:{
                add:function () {
                    this.vage.push({'name':'youyisi'})
                },
                remove:function () {
                    this.vage.shift()
                    // 或者splice(下标,删除几个)
                    // 清空可以重新赋值 =[]
                }
            }
        })
    </script>
</body>
</html>